<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script type="text/javascript">
			function load(){
				let c = document.getElementById('myC');
				let context = c.getContext('2d');

				context.fillStyle='#FF00FF';
				context.fillRect(50,25,300,150);
			}

			window.onload = function(){
				if(checkSupport()){
					load();
				}

			}

			function checkSupport() {
				let c = document.getElementById('myC');
				if(c.getContext){
					console.log('support canvas!');
					return true;
				}else{
					console.log('not support canvas!');
					return false;
				}
			}
		</script>
	</head>
	<body>
		<canvas id="myC" style="border: 1px #000 solid;" width="800" height="450">
			你的浏览器不支持canvas元素！
		</canvas>
	<div><script language="javascript">

	</script></div></body>
</html>
